const gbkCoder=new TextDecoderStream();
const jis='嬚梩巓枀偲儔僀僒儞僩搰偺揱愢';
function click_gbk(){
    const gbkText = document.getElementById('gbk').value;
    // jisText=JSON.stringify(gbkText).decode('gbk').encode('shift-jis');
    alert(jis)
}

function showJIS(){
    var str = "あいう";

    var bytes = Utilities.newBlob("").setDataFromString(str, "Shift_JIS").getBytes();
    var res = bytes.map(function(byte) {return "%" + ("0" + (byte & 0xFF).toString(16)).slice(-2)}).join("").toUpperCase();
    // Logger.log(res)
    console.log(res);
}

